package com.lab.mapper;

import com.lab.dto.LeaveRequestPageQueryDTO;
import com.lab.entity.LeaveRequest;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface LeaveRequestMapper {
    int countByMemberAndWeek(Integer memberId, String weekIdentifier);

    int insert(LeaveRequest leaveRequest);

    /**
     * 根据ID查询请假申请
     */
    LeaveRequest selectById(Integer leaveId);
    /**
     * 根据ID更新请假申请
     */
    int updateById(LeaveRequest leaveRequest);




    List<LeaveRequest> pageQuery(
            @Param("q") LeaveRequestPageQueryDTO queryDTO,  // 随便起个短名，比如q
            @Param("s") int start,
            @Param("ps") int pageSize
    );
    // 统计符合条件的总记录数
    Long countByCondition(LeaveRequestPageQueryDTO queryDTO);
    // 分页查询
}
